import request from '@/utils/request'

// 快递员表格信息
export const getCourier = (params) => {
  return request({
    method: 'get',
    url: '/business-hall/courier/page',
    params
  })
}
// 作业范围地图
export const getWorkAreaMap = (id) => {
  return request({
    method: 'get',
    url: `/business-hall/scope/${id}/2`,
    params: {
      0: id
    }
  })
}
// 司机管理表格
export const getDriver = (params) => {
  return request({
    method: 'get',
    url: '/driver/page',
    params
  })
}
// 司机详情
export const getDriverDetail = (id) => {
  return request({
    method: 'get',
    url: '/driver/' + id,
    params: {
      0: id
    }
  })
}
// 驾驶证详情
export const getDriverLicense = (id) => {
  return request({
    method: 'get',
    url: '/driverLicense/' + id,
    params: {
      0: id
    }
  })
}
// 保存司机信息
export const editDriverDetail = (data) => {
  return request({
    method: 'put',
    url: '/driver/' + data.userId,
    data
  })
}
// 保存驾驶证信息
export const editDriverLicense = (data) => {
  return request({
    method: 'post',
    url: '/driverLicense',
    data
  })
}
// 获取未工作车辆
export const getUnWorkingTrucks = () => {
  return request({
    method: 'get',
    url: '/unWorkingTrucks'
  })
}
// 排班信息
export const getWorkSchedulings = (params) => {
  return request({
    method: 'get',
    url: '/work-schedulings',
    params
  })
}
// 模式名称
export const getAllModes = () => {
  return request({
    method: 'get',
    url: '/work-patterns/all'
  })
}
// 人工调整
export const editModes = (data) => {
  return request({
    method: 'put',
    url: '/work-schedulings',
    data
  })
}
// 排班设置
export const getWorkPatterns = (params) => {
  return request({
    method: 'get',
    url: '/work-patterns/page',
    params
  })
}
// 新增工作模式
export const addWorkSetting = (data) => {
  return request({
    method: 'post',
    url: '/work-patterns',
    data
  })
}
// 删除工作模式
export const delWorkSetting = (id) => {
  return request({
    method: 'delete',
    url: '/work-patterns/' + id
  })
}
// 获取工作模式详情
export const getWorkPatternsDeatil = (id) => {
  return request({
    method: 'get',
    url: '/work-patterns/' + id
  })
}
// 编辑工作模式
export const editWorkSetting = (data) => {
  return request({
    method: 'put',
    url: '/work-patterns',
    data
  })
}
